package com.ruleengine.instruction.impl;

import com.ruleengine.instruction.Instruction;
import com.ruleengine.instruction.InstructionType;

public abstract class BaseInstruction implements Instruction{
    protected InstructionType type;
    protected boolean synchronize=true;
    protected int instructionOffset;
    
    public BaseInstruction(InstructionType type) {
        super();
        this.type = type;
    }

    public InstructionType getInstructionType() {
        return this.type;
    }

    public void setInstructionType(InstructionType type) {
        this.type = type;
    }
    

    public int getInstructionOffset() {
        // TODO Auto-generated method stub
        return instructionOffset;
    }

    public void setInstructionOffset(int offset) {
        // TODO Auto-generated method stub
        instructionOffset = offset;
    }

    /**
     * @return the synchronize
     */
    public boolean isSynchronize() {
        return synchronize;
    }

    /**
     * @param synchronize the synchronize to set
     */
    public void setSynchronize(boolean synchronize) {
        this.synchronize = synchronize;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return instructionOffset + "," + type;
    }

}
